<?php

function micro_time()
{
   list($usec, $sec) = explode(" ", microtime());
   return ($usec * 1000000 + $sec * 1000000);
}

$redis = new Redis();
$redis->connect('127.0.0.1', 6379);
$redis->set('a', 'a');
$starttime = micro_time();
$res = $redis->get('a');
$endtime = micro_time();
var_dump("时间差:" . ($endtime - $starttime));
var_dump($res);